search for: active_model

Displaying 20 results from an estimated 21 matches for "active_model".

2014 Feb 17
0
Need help -FATAL: database "catarse_development" does not exist
...e_methods/primary_key.rb:65:in `primary_key' /usr/local/rvm/gems/ruby-1.9.3-p484/gems/protected_attributes-1.0.5/lib/active_record/mass_assignment_security/attribute_assignment.rb:15:in `attributes_protected_by_default' /usr/local/rvm/gems/ruby-1.9.3-p484/gems/protected_attributes-1.0.5/lib/active_model/mass_assignment_security.rb:332:in `block in protected_attributes_configs' /usr/local/rvm/gems/ruby-1.9.3-p484/gems/protected_attributes-1.0.5/lib/active_model/mass_assignment_security.rb:217:in `yield' /usr/local/rvm/gems/ruby-1.9.3-p484/gems/protected_attributes-1.0.5/lib/active_model/mas...
2011 Jan 06
4
Not able to insert value in rails console
...activerecord-3.0.3/lib/active_reco rd/relation/finder_methods.rb:180:in `exists?'' from c:/Ruby/lib/ruby/gems/1.9.1/gems/activerecord-3.0.3/lib/active_reco rd/validations/uniqueness.rb:39:in `validate_each'' from c:/Ruby/lib/ruby/gems/1.9.1/gems/activemodel-3.0.3/lib/active_model /validator.rb:154:in `block in validate'' from c:/Ruby/lib/ruby/gems/1.9.1/gems/activemodel-3.0.3/lib/active_model /validator.rb:151:in `each'' from c:/Ruby/lib/ruby/gems/1.9.1/gems/activemodel-3.0.3/lib/active_model /validator.rb:151:in `validate'' f...
2012 Sep 18
2
undefined method `to_sym' for nil:NilClass
...3 and am getting this error when trying to login: NoMethodError in AuthenticateController#authenticate undefined method `to_sym'' for nil:NilClass The stack trace is: activerecord (3.2.2) lib/active_record/validations/uniqueness.rb:26:in `validate_each'' activemodel (3.2.2) lib/active_model/validator.rb:153:in `validate'' activemodel (3.2.2) lib/active_model/validator.rb:150:in `each'' activemodel (3.2.2) lib/active_model/validator.rb:150:in `validate'' activesupport (3.2.2) lib/active_support/callbacks.rb:310:in `send'' activesupport (3.2.2) lib/active...
2013 Oct 23
0
Error: allocator undefined for Proc
...`load'' /usr/lib/ruby/1.8/yaml.rb:133:in `load'' /usr/lib/ruby/site_ruby/1.8/puppet/util/rails/reference_serializer.rb:6:in `unserialize_value'' /usr/lib/ruby/site_ruby/1.8/puppet/rails/param_value.rb:36:in `value'' /usr/lib/ruby/gems/1.8/gems/activemodel-3.0.0/lib/active_model/dirty.rb:144:in `__send__'' /usr/lib/ruby/gems/1.8/gems/activemodel-3.0.0/lib/active_model/dirty.rb:144:in `attribute_change'' /usr/lib/ruby/gems/1.8/gems/activemodel-3.0.0/lib/active_model/dirty.rb:118:in `changes'' /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.0/lib/act...
2012 Sep 25
3
Proposal for a new ActiveModel::Errors structure
There are few issues with the current ActiveModel::Errors class. Firstly, when an error is added to ActiveModel::Errors class via #add method (https://github.com/rails/rails/blob/master/activemodel/lib/active_model/errors.rb#L294) its translation is added. It should not be translated when being added, but only when being read. The second issue is a bit bigger. We''d like to create error responses in our API similar to GitHub: { "message": "Validation Failed", "erro...
2013 Mar 14
7
No Migration Files are created
I''ve been working with Rails for 3 Months now, but haven''t experienced this problem until now. I''m currently working through Micharl Hartls Tutorial and everything worked fine so far, but suddenly (chapter 11) I can nolonger create Migration Files. when entering "rails g model Name field1:type" I don''t get the usual "create db/migrate...."
2011 Jun 11
15
after initialize blowing up---help
All, Can anyone see what''s happening here? ================== migration ======================= class CreateGreetings < ActiveRecord::Migration def self.up create_table :greetings do |t| t.string :greet t.string :language t.integer :count t.timestamps end end def self.down drop_table :greetings end end ================== greeting.rb
2011 Feb 03
5
Ignore attr_accessible in seed file
Is there a way to tell Rails to ignore attr_accessible when seeding the database and to allow mass assignment with create or new? I know how to skip validations but do not find anything on mass assignment... -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to
2010 Jul 28
3
Rails 3.0.0.rc // rails locales prevent app boot
...ray into String (TypeError) When I put some debug code on that line I see the follwing array being passed; ["/Users/smath/.rvm/gems/ruby-1.8.7-p299/gems/activesupport-3.0.0.rc/ lib/active_support/locale/en.yml", "/Users/smath/.rvm/gems/ruby-1.8.7- p299/gems/activemodel-3.0.0.rc/lib/active_model/locale/en.yml", "/ Users/smath/.rvm/gems/ruby-1.8.7-p299/gems/activerecord-3.0.0.rc/lib/ active_record/locale/en.yml", "/Users/smath/.rvm/gems/ruby-1.8.7-p299/ gems/actionpack-3.0.0.rc/lib/action_view/locale/en.yml", ["/werkmap/ projects/skylight/twizzi2/config/locales...
2012 Jan 25
4
serializable_hash and serializable_add_includes
I''m trying to write a helper method similar to attr_accessible but instead it will be used to whitelist which attributes are available for serialization (attr_serializable). My first attempt at this was to override serialized_hash and modify the :only option to include nothing but serializable attributes. I''m facing a problem when nested models are ''included''
2011 Nov 07
2
Problem with Rails3.1.1 in mass_assignment_authorizer
By accident I had Rails-3.1.1 installed by bundler. However, when I discovered this mishap during my feature run I encountered this error in many places: wrong number of arguments (1 for 0) (ArgumentError) /home/byrnejb/.rvm/gems/ruby-1.8.7-p352/gems/activemodel-3.1.1/ lib/active_model/mass_assignment_security.rb:209:in `mass_assignment_authorizer'' /home/byrnejb/.rvm/gems/ruby-1.8.7-p352/gems/activemodel-3.1.1/ lib/active_model/mass_assignment_security.rb:209:in `sanitize_for_mass_assignment'' /home/byrnejb/.rvm/gems/ruby-1.8.7-p352/gems/activerecord-...
2011 Feb 05
3
ActiveModel::AttributeMethods limiting
...e methods step-by-step in DataMapper-like manner. class Model include ActiveModel::Dirty def self.property(name, klass = String) define_property_accessors(name, klass) # This method will be called once, because of https://github.com/rails/rails/blob/master/activemodel/lib/active_model/attribute_methods.rb#L263 define_attribute_methods([name]) end end class Article < Model property :title property :body property :published_at, Time end In the above example, attribute methods will be defined just for :title. I don''t see any nice workaround. S...
2010 Aug 22
7
Rails 3: Error saving an object with no useful information
...ce it doesn''t give me any information hinting where the problem is: irb(main):054:0> reload!;User.last.save! Reloading... NameError: undefined local variable or method `to_ary'' for #<User:0x4ed5d20> from D:/ruby192/lib/ruby/gems/1.9.1/gems/activemodel-3.0.0.rc/lib/active_model/attribute_methods.rb:364:in `method_missing'' from D:/ruby192/lib/ruby/gems/1.9.1/gems/activerecord-3.0.0.rc/lib/active_record/attribute_methods.rb:46:in `method_missing'' from D:/ruby192/lib/ruby/gems/1.9.1/gems/activerecord-3.0.0.rc/lib/active_record/connection_ada...
2011 Jan 02
0
"Confirmation" succeeds when the *_confirmation attribute was neglected from the Model.
...: # Oops! I forgot to add the :password_confirmation attribute! class User < ActiveRecord::Base attr_accessor :password attr_accessible :password #, :password_confirmation validates(:password, :confirmation => true, :presence => true) end activemodel/lib/active_model/validations/confirmation.rb: 3 # == Active Model Confirmation Validator 4 module Validations 5 class ConfirmationValidator < EachValidator 6 def validate_each(record, attribute, value) 7 if (confirmed = record.send("#{attribute}_confirmation")) &&am...
2011 Feb 09
0
Weird error after upgrading to rails 3.0.4
Hey folks, have you seen this ever? [user@i ~/rails_project]$ rake rails:update --trace (in /usr/home/rails_project) rake aborted! uninitialized constant ActiveModel::Validations::HelperMethods /usr/local/lib/ruby/gems/1.8/gems/activemodel-3.0.4/lib/active_model/ validations.rb:50 /usr/local/lib/ruby/gems/1.8/gems/activesupport-3.0.4/lib/ active_support/concern.rb:52:in `class_eval'' /usr/local/lib/ruby/gems/1.8/gems/activesupport-3.0.4/lib/ active_support/concern.rb:52:in `append_features'' /usr/local/lib/ruby/gems/1.8/gems/activesupport-3...
2011 May 02
0
Change from 3.0.6 => Rails 3.0.7 "no such file to load -- action_mailer/railtie"
In my application.rb, I have this: #require "rails/all" require "action_controller/railtie" require "action_mailer/railtie" require "active_resource/railtie" require "active_model/railtie" (I didn''t want ActiveRecord) This worked fine up to 3.0.6, but now fails with: /Users/jeffdeville/Documents/code/ruby/wg/config/application.rb:6:in `require'': no such file to load -- action_mailer/railtie (LoadError) from /Users/jeffdeville/Documents/code/ruby/wg...
2012 Aug 05
0
ActiveRecord::Validator vs ActiveModel::Validator
I know that there is an ActiveModel Validator class https://github.com/rails/rails/blob/master/activemodel/lib/active_model/validator.rb which is used for the class level validation macros. But I didn''t find a an ActiveRecord Validator class. From my understanding in Rails 3, validations have been moved into ActiveModel to leave ActiveRecord as an ORM. So now I see this Rails 3 code in a Rails 3 book and ge...
2010 Jul 12
2
[R3B4] errors[:base] = appends, doesn't "set" - bug, feature, or "error 18"?
If you haven''t heard, an "error 18" means "the error is 18 inches from the screen." Which would mean that I totally get that this could just be me being stupid. However, for some reason I''m thinking this violates the normal behavior of an Array object, so I''m curious as to if I''m doing something wrong here, or if something really is buggy
2010 Feb 20
23
Rails 3 possible bug in Routing
Hi, I just ran into this ActionController::RoutingError and just wanted to check if someone can confirm this as a bug in the Rails 3 beta gem. config/routes.rb contains: get ''login'' => ''session#new'' post ''login'' => ''session#create'', :as => :login GET /login works fine: Started GET
2010 Jan 20
1
CRITICAL: Rails 3 error : parser.bundle unhandled exception!!!
...uby/gems/1.8/gems/activesupport-3.0.pre/lib/ active_support/dependencies.rb:537:in `new_constants_in'' from /opt/local/lib/ruby/gems/1.8/gems/activesupport-3.0.pre/lib/ active_support/dependencies.rb:167:in `require'' from /opt/local/lib/ruby/gems/1.8/gems/activemodel-3.0.pre/lib/ active_model/serializers/json.rb:1 from /opt/local/lib/ruby/gems/1.8/gems/activerecord-3.0.pre/lib/ active_record/serialization.rb:4 from /opt/local/lib/ruby/gems/1.8/gems/activerecord-3.0.pre/lib/ active_record/base.rb:2745 from /opt/local/lib/ruby/gems/1.8/gems/activerecord-3.0.pre/lib/ active_record/base....