search for: const_defined

Displaying 20 results from an estimated 36 matches for "const_defined".

2006 Jun 02
6
overriding constants
...''m trying to override the defaults for form_helper. I can see in action_view/helpers/form_helper.rb: class InstanceTag #:nodoc: include Helpers::TagHelper attr_reader :method_name, :object_name DEFAULT_FIELD_OPTIONS = { "size" => 30 }.freeze unless const_defined?(:DEFAULT_FIELD_OPTIONS) DEFAULT_RADIO_OPTIONS = { }.freeze unless const_defined?(:DEFAULT_RADIO_OPTIONS) DEFAULT_TEXT_AREA_OPTIONS = { "cols" => 40, "rows" => 20 }.freeze unless const_defined?(:DEFAULT_TEXT_AREA_OPTIONS) DEFAULT_DATE_OPTIONS = { :dis...
2007 Apr 18
1
Postgres-pr interface not found
I''ve installed the postgres-pr gem, and it is found using gem list v0.4.0. In my active record source, inside the postgresql_adapter.rb file, I''ve changed line 7 from: require_library_or_gem ''postgres'' unless self.class.const_defined?(:PGconn) to: require_library_or_gem ''postgres-pr'' unless self.class.const_defined?(:PGconn) ...to try and force it to use the postgres-pr interface, but I get the following error when loading a page: no such file to load -- postgres-pr Why can''t it find that gem? OSX...
2010 Jun 21
4
Failing Routes in deployment
...The route shows correctly in ''heroku rake routes'' Logs are showing: ActionController::RoutingError (wrong constant name Admin/ homeController): /disk1/home/slugs/196384_c95a9e3_4463/mnt/.bundle/gems/gems/ activesupport-3.0.0.beta4/lib/active_support/inflector/methods.rb: 103:in `const_defined?'' Any ideas? -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonra...
2007 Mar 28
3
attachment_fu Not Resizing
...sor.rb: module ClassMethods # Yields a block containing an RMagick Image for the given binary data. def with_image(file, &block) begin binary_data = file.is_a?(Magick::Image) ? file : Magick::Image.read(file).first unless !Object.const_defined?(:Magick) puts "binary_data.nil? : #{binary_data.nil?}" puts "file.nil?: #{file.nil?}" puts "const_defined? : #{Object.const_defined?(:Magick)}" rescue # Log the failure to load the image. This s...
2010 Jul 30
1
[PATCH 1/2] Monkey-patch mongrel to fix rails 2.3.5 incompatibility
...ring and options['cookie'] + header_without_rails_fix(options) + end + alias_method_chain(:header, :rails_fix) +end if (Rails.version == '2.3.5' or Rails.version == '2.3.8') and Gem.available?('mongrel', Gem::Requirement.new('~>1.1.5')) and self.class.const_defined?(:Mongrel) + -- 1.7.2
2006 Sep 04
1
Overriding ActionView::Helpers::InstanceTag::DEFAULT_TEXT_AREA_OPTIONS
What is the best way to override some of the FormHelper default options? Right now I''m adding this to the beginning of my environment.rb: ActionView::Helpers::InstanceTag::DEFAULT_TEXT_AREA_OPTIONS = { "cols" => 80, "rows" => 5 } Is that the way it''s supposed to be done? --~--~---------~--~----~------------~-------~--~----~ You received this message
2013 Feb 11
27
Certificate verify fails without indications
I have a puppet master on Centos 6.3 connected and working properly with other Centos 6.3 agent. I installed puppet agent via gems on a RED HAT 4 node. This is what happens when I try to sign certificate for the new node: AGENT [root@FP2 ~]$ puppet agent -t Info: Creating a new SSL key for fp2 Info: Caching certificate for ca Info: Creating a new SSL certificate request for fp2 Info:
2007 Oct 30
5
Using Standard Integration Tests with RSpec
Hi there. I am using RSpec for unit and functional testing on a project. I have however found the (experimental) RSpec stories to be un-intuitive in some situations. The RSpec plugins seems to disable the standard Rails Tests, so how could I go about usng Integration tests alongside Rspec? Thanks. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~
2014 Feb 12
61
P2V: Headless support
This introduces support to run P2V without X server. Runtime parameters are specified via kernel command line making it hopefully suitable for automated migration with a little help of PXE boot. Patchset is not squashed and represents dev. history.
2006 Aug 17
2
Creating function name from variables..
...''Good'', ''Bad'', ''Ugly'' and also sends back the value of the result[e] above into the correct format. So, I have helpers for each of the fields. FLAGMEAN = [ " ", "!", "+", "-", "*" ] unless const_defined?("FLAGMEAN") def format_abc(val, flag) a = sprintf ("%.1f",(val/ 10.0)) b = FLAGMEAN[flag] return a, b end def format_def(val, flag) a = sprintf ("%.1f",(val/ 100.0)) ........ end These need to be separate function since the divi...
2006 May 16
1
ActionMailer w/o database link (e.g., feedback form)
Hey, A total noobieQ. Apologies, still learning. Could anyone point me to examples of a non-database-driven feedback form, for instance, a simple e-mail feedback form that takes advantage of ActionMailer? (How do I carry a POST through to a ''def'' w/o a database connection?) Thanks! -- Posted via http://www.ruby-forum.com/.
2006 Aug 15
1
Camping with Dr. Nic
Campers. Dr. Nic. The new migrations in Camping''s trunk are very nice. They also open the door (just an inch) to using Dr. Nic''s Magic Models with Camping. Here''s my stab at ''er: http://require.errtheblog.com/camping/blog.rb Run that against Camping trunk. Don''t forget to `sudo gem install dr_nic_magic_models`. The hackery is in
2006 Mar 16
0
UserEngine and the test environment
...granted_to_home_page get :index assert_response :success end end Obviously, this test fails. If I change the dev DB, I can test in the browser, and it works fine. But, the test DB does not contain the necessary permissions and roles. I added this to test/test_helper.rb: unless Object.const_defined?(''PermissionSynchronized'') $stderr.puts "Synchronizing permissions" Permission.sychronize_controllers PermissionSynchronized = true end which ensures my permissions are created for the test environment. The only thing missing is now roles. How should I map them...
2012 Sep 28
0
Overriding class_attribute writers and order of super/extend C.M./included block eval in ActiveSupport::Concern
...happen in Concern''s def append_features(base) method were different and maybe then I could just override things in the ClassMethods module for class methods and the main block of the module for instance methods: super base.extend const_get("ClassMethods") if const_defined?("ClassMethods") base.class_eval(&@_included_block) if instance_variable_defined?("@_included_block") And there are classes like this that only benefit from the dependency handling and included block class_eval part of Concern that maybe could benefit from that b...
2005 Aug 23
0
Fixtures: pluraly bitten
...are bad, but their handling in Rails is blatant violation of the DRY principle. Fixtures has a method for resetting PostgreSQL sequences def self.reset_sequences(connection, table_names) table_names.flatten.each do |table| table_class = Inflector.classify(table.to_s) if Object.const_defined?(table_class) pk = eval("#{table_class}::primary_key") if pk == ''id'' connection.execute( "SELECT setval(''#{table.to_s}_id_seq'', (SELECT MAX(id) FROM #{table.to_s}), true)", ''Setting S...
2010 Apr 09
0
Ocra: can't execute the executable
...work. I create everything without any errors - i make my rails app - i create a file init.rb that makes "load script/server" - i create a single rb file with tar2rubyscript foldername - i run ocra --console filename.rb - i add this line at the top of filaname.rb: "exit if Object.const_defined?(:Ocra)". (without this, after he launchs the server, how can i make create the executable? if i stop the server it does not create it!) - filename-exe -> "missing the rails 2.3.5 gem...." obviously i have this version of rails! (but shouldn''t it be a standalone execut...
2007 Jun 08
4
Mocha 0.5 released
* Hamcrest-style parameter matchers * Values returned and exceptions raised on consecutive invocations * Yields on consecutive invocations * Multiple yields on single invocation * Invocation dispatch fixed * Deprecated returning result of a Proc -- James. http://blog.floehopper.org
2005 Mar 02
1
404 and NameError
...or in the logs. I''ve tried catching NameError for non local IP''s, but this doesn''t seem to get caught for some reason. NameError (wrong constant name test.phpController): /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.0.0/lib/active_support/dep endencies.rb:95:in `const_defined?'' /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.0.0/lib/active_support/dep endencies.rb:95:in `const_available?'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.5.0/lib/action_controller/rou ting.rb:138:in `eat_path_to_controller'' /usr/local/lib/ruby/gems/1.8/gem...
2010 Jan 31
3
Removing scaffold?
...p using the nifty-scaffold plugin. However, I messed up the syntax and forgot the model name, so it ended up being called "Title:string". I now can''t run any tasks from the terminal as I get the following error: vendor/rails/activesupport/lib/active_support/inflector.rb:352:in `const_defined?'': wrong constant name Title:stringsHelper Followed by lines of other complaints. I''ve deleted the migration, controller, model and view files, but the error continues to occur. What else do I need to get rid of? Any advice appreciated. Thanks -- Posted via http://www.ruby-f...
2006 Jan 17
15
legacy database and finder_sql nightmare!
This is my first rails app with a legacy database and I''m having a terrible time getting the models set up correctly. I have an order table that has a primary field named order_number. I have a name table with a primary of item_number. These two tables are liked by the item_number and the order_number, but not as you might think. If the order_number is 2500, then each entry in