Skip to content

Commit

Permalink
I am getting weird errors where symbols are not getting turned into s…
Browse files Browse the repository at this point in the history
…trings in database queries. These were the last two fixes I need to make (hopefully) to finish fixing the problem.
  • Loading branch information
jeremiahishere committed Apr 6, 2012
1 parent 2e45d85 commit c085d0e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/models/dynamic_fieldsets/fieldset_associator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def unique_fieldset_model_name_per_polymorphic_fieldset_model
# @params [Hash] args A hash of arguments for the scope
# @returns [Array] An array of fieldset associators that match the arguments
def self.find_by_fieldset_model_parameters(args)
fieldset = Fieldset.where(:nkey => args[:fieldset]).first
fieldset = Fieldset.where(:nkey => args[:fieldset_nkey].to_s).first
throw "Fieldset not found in FieldsetAssociator.find_by_fieldset_model_parameters" if fieldset.nil?

where(
Expand Down
6 changes: 3 additions & 3 deletions lib/dynamic_fieldsets/dynamic_fieldsets_in_model.rb
Original file line number Diff line number Diff line change
Expand Up @@ -269,14 +269,14 @@ def fieldset_associator(sym)
fsa = DynamicFieldsets::FieldsetAssociator.find_by_fieldset_model_parameters(
:fieldset_model_id => self.id,
:fieldset_model_type => self.class.name,
:fieldset_model_name => sym,
:fieldset_id => self.dynamic_fieldsets[sym][:fieldset]).first.id
:fieldset_model_name => sym.to_s,
:fieldset_nkey => self.dynamic_fieldsets[sym][:fieldset].to_s).first
if fsa.nil?
fsa = DynamicFieldsets::FieldsetAssociator.new(
:fieldset_model_id => self.id,
:fieldset_model_type => self.class.name,
:fieldset_model_name => sym.to_s,
:fieldset_id => DynamicFieldsets::Fieldset.where(:nkey => self.dynamic_fieldsets[sym][:fieldset]).first.id)
:fieldset_id => DynamicFieldsets::Fieldset.where(:nkey => self.dynamic_fieldsets[sym][:fieldset].to_s).first.id)
end
return fsa
else
Expand Down

0 comments on commit c085d0e

Please sign in to comment.