Displaying 10 results from an estimated 10 matches for "attr_".
Did you mean:
attr
2006 Sep 05
5
cattr_accessor
Hi,
i''ve been playing with ror for a little over two months now, and was
wondering wether someone could explain to me what was
cattr_accessor
and if it is still in use. . . i looked up in api.rubyonrails.com and
coulnd''t find any documentation...
is it a useful/worth learning method? what do u use it for?
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received thi...
2006 Jun 05
2
When adding a record in console, a parameter comes in as null even when I set it
...ndard Time 2006, "email"=>"support@mydomain.com"},
@errors=#<ActiveRecord::Errors:0x3b51e88 @base=#<User:0x3b55158 ...>,
@errors={}>, @new_record=false, @password=nil>
I am doing some things in the user.rb Model file and I think it has
something to do with the attr_ bits which I don''t fully understand.
my user.rb file... any ideas?
require "digest/sha1"
class User < ActiveRecord::Base
belongs_to :account
attr_accessor :password
attr_accessible :username, :password, :email, :name
validates_uniqueness_of :username, :scope => :...
2007 Aug 09
7
Modules in lib not follwing naming convension
Hej! Okey i have a problem, i have earlier written a set of classes in
ruby implementing a msrp chat client and now im trying to use it in my
rails app.
The msrp implementation consists of several files and most of the
functions and classes in those files ar encapsulated in a module lets
call it X. so for instance they look like this
header.rb
module X
class Z
...
end
end
The problem now
2006 Nov 04
2
Possible to use attr_reader/writer in model?
I have some properties that I want setable externally, but readable only
internally. I''ve played around with attr_writer (and attr_reader
separately) but can''t figure out how to get either to work. I can do
what I want using attr_accessor, or just straight out defining the prop
setter method. Anybody know how to use attr_writer or attr_reader with a
model?
You da man,
Joe
--
Posted via http://ww...
2005 Apr 23
7
Validation question
Hi all,
Is there a way to invoke validations at times other than save, create
and update? I know that I can do this by writing my own validation
checks using errors.add_[blah], but I''d like to leverage the existing
validation code.
What I have is two sets of fields in a record, set A and set B. Both
sets must be validated on record create. However, the trouble is that
after
2012 Jul 09
10
attr_accessible on some properties + attr_protected on others makes class 'open-by-default'
(I posted this as a bug in GitHub
(https://github.com/rails/rails/issues/7018), but then someone there told
me I should post it here, so here it is.)
If you set attr_accessible on some properties in an ActiveRecord-descended
class, and then attr_protected on others - the class becomes ''default-open''
- if any properties are missed or added later, they will be accessible by
default to MassAssignment.
This undoes the entire point of having put...
2011 Oct 25
7
additional model attributes
...es me data to create a new place
object.
I would like to add the address from the external place to the place
object and render it as a json result, without storing it in the
database.
i don''t get any errors, but the address never shows up within the json
output. i''ve tried with attr_accessor but that didn''t work either.
any hints?
thanks
==========================================
place.rb
class Place < ActiveRecord::Base
attr_accessor: address
end
==========================================
places_controller.rb
external_api_place_data = @client.find(place_...
2006 Mar 14
4
validates_confirmation_of has stopped working
Hi Railers,
I''m past considering myself a noob in Rails land - I think what I''m up against
here is more of a bug or an anomaly that I''m unaware of (or that has changed
in a recent version).
I had a fully working validates_confirmation_of :email_address field in my app
- was one of the first things I set up, extremely simple, been working for a
long time.
Then one
2006 Nov 04
0
traits-0.9.2 - better living through metaprogramming
URLS
http://rubyforge.org/projects/codeforpeople/
http://codeforpeople.com/lib/ruby/traits
ABOUT
traits.rb is set of attr_* like methods on steroids, caffeine, and botox. it
encourages better living through meta-programming and uniform access
priciples. traits.rb supports smart inheritence of class attributes and a
fistful of hooks for veryifying and munging attr values.
VERSION
0.9.2
HISTORY
0.9.2...
2006 Nov 04
0
traits-0.10.0
URLS
http://rubyforge.org/projects/codeforpeople/
http://codeforpeople.com/lib/ruby/traits
INSTALL
yes|sudo gem install traits
ABOUT
traits.rb is set of attr_* like methods on steroids, caffeine, and botox.
it encourages better living through meta-programming and uniform access
priciples. traits.rb supports smart inheritence of class attributes and a
fistful of hooks for veryifying and munging attr values.
VERSION
0.10.0
HISTORY
0.10.0...